<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('tables', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('type_id');
            $table->unsignedInteger('sort')->comment('编号');
            $table->string('name')->nullable()->comment('名称');
            $table->unsignedInteger('people_count')->comment('人数');
            $table->string('status')->default(\App\Enums\TableStatus::Idle->value)->comment('桌台使用状态');
            $table->dateTime('use_start_at')->nullable()->comment('开始使用时间');
            $table->bigInteger('table_order_id')->nullable()->comment('当前table order id');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('tables');
    }
};
